package com.example.onlineeducation.data.constant

import androidx.annotation.ColorRes
import androidx.annotation.DrawableRes
import androidx.annotation.StringDef
import com.example.onlineeducation.R
import com.yc.jetpacklib.utils.YcResources

/**
 * SimpleDes:
 * Creator: Sindi
 * Date: 2022-01-17
 * UseDes:考试
 */
object OfflineExamConstants {
    const val NOT_TESTED = "-1"//未考试
    const val UN_PASSED = "0"//未通过
    const val PASSED = "1"//已通过

    @StringDef(UN_PASSED, PASSED, NOT_TESTED)
    @kotlin.annotation.Retention(AnnotationRetention.SOURCE)
    annotation class Result //是否通过 0=未通过  1=已通过   -1=未考试


    fun showResultText(@Result str: String): String {
        return when (str) {
            PASSED -> "已通过"
            UN_PASSED -> "未通过"
            NOT_TESTED -> "未考试"
            else -> "-"
        }
    }

    @DrawableRes
    fun showResultBg(@Result str: String): Int {
        return when (str) {
            PASSED -> R.drawable.shape_round_exam_label_pass
            UN_PASSED -> R.drawable.shape_round_exam_label_unpass
            NOT_TESTED -> R.drawable.shape_round_exam_label_unpass
            else -> R.drawable.shape_round_exam_label_unpass
        }
    }

}